<template>
  <h1>这个是App组件</h1>
  <button @click="show = false">删除组件</button>
  <HelloWorld v-if="show"></HelloWorld>
</template>

<script>
import { ref } from "@vue/reactivity";
import HelloWorld from "./components/HelloWorld.vue";
export default {
  name: "App",
  components: { HelloWorld },
  setup() {
    let show = ref(true);
    function changeState() {
      this.show = false;
    }

    return {
      show,
      changeState,
    };
  },
};
</script>

<style>
</style>